﻿using J.Status.Application.Command.RoomTypeCommand;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.RoomTypeHandler
{
    public class RoomNumCountHandler : IRequestHandler<RoomNumCountCommand, int>
    {
        private readonly IRoomTypeService roomTypeService;

        public RoomNumCountHandler(IRoomTypeService roomTypeService)
        {
            this.roomTypeService = roomTypeService;
        }

        public async Task<int> Handle(RoomNumCountCommand request, CancellationToken cancellationToken)
        {
            return await roomTypeService.RoomNumCount(request.roomTypeId);
        }
    }
}
